<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">


<head th:replace="fragments/common_header :: common-header(~{},~{})"></head>
<body>
<div id="wrapper">
    <!-- 左侧菜单栏-->
    <div th:replace="fragments/common_leftmenu :: left-menu"></div>
    <!-- 左侧菜单栏结束-->
    <div id="page-wrapper" class="gray-bg">
        <!-- 上部导航条 -->
        <div th:replace="fragments/common_top :: top-bar"></div>
        <!-- 上部导航条结束 -->
        <!--内容-->
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="ibox ">
                <!--列表-->
                <div class="ibox-title">
                    <h3>订单列表</h3>
                    <button class="btn btn-sm btn-primary"
                            th:onclick="@{'location.href=\'' + ${#httpServletRequest.getContextPath()}+'/order/toAdd\''}">
                        新增订单
                    </button>

                </div>
                <div class="ibox-content">
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover dataTables-example">
                            <thead>
                            <tr th:align="center">
                                <td>订单编号</td>
                                <td>取车时间</td>
                                <td>还车时间</td>
                                <td>汽车编号</td>
                                <td>订单时间</td>
                                <td>取车地点</td>
                                <td>取车门店名称</td>
                                <td>还车地点</td>
                                <td>还车门店名称</td>
                                <td>用户身份证号</td>
                                <td>车辆类型</td>
                                <td>车辆名称</td>
                                <td>订单状态</td>
                                <td>订单金额</td>
                                <td>汽车押金</td>
                                <td>用户电话</td>
                                <td>服务费</td>
                                <td>异地还车费</td>
                                <td>操作</td>
                            </tr>
                            </thead>
                            <tbody>
                            <tr th:each="order:${orders}">
                                <td th:text="${order.getOrder_number()}"></td>
                                <td th:text="${order.getTake_time()}"></td>
                                <td th:text="${order.getReturn_time()}"></td>
                                <td th:text="${order.getCar_number()}"></td>

                                <td th:text="${order.getOrder_time()}"></td>
                                <td th:text="${order.getTake_place()}"></td>
                                <td th:text="${order.getTake_shop_name()}"></td>
                                <td th:text="${order.getReturn_place()}"></td>
                                <td th:text="${order.getReturn_shop_name()}"></td>
                                <td th:text="${order.getUser_id()}"></td>
                                <td th:text="${order.getCar_type()}"></td>
                                <td th:text="${order.getCar_name()}"></td>
                                <td th:text="${order.getOrder_state()}"></td>
                                <td th:text="${order.getOrder_amount()}"></td>
                                <td th:text="${order.getCar_deposit()}"></td>
                                <td th:text="${order.getUser_phone()}"></td>
                                <td th:text="${order.getOrder_fuwu()}"></td>
                                <td th:text="${order.getOrder_yidi()}"></td>

                                <td>
                                    <button class="btn btn-sm btn-primary"
                                            th:onclick="@{'location.href=\'' + ${#httpServletRequest.getContextPath()}+'/order/toEditState/'+${order.getOrder_number()}+'\''}">
                                        修改状态
                                    </button>
                                    <button class="btn btn-sm btn-primary"
                                            th:onclick="@{'location.href=\'' + ${#httpServletRequest.getContextPath()}+'/order/toEdit/'+${order.getOrder_number()}+'\''}">
                                        编辑
                                    </button>
                                    <button class="btn btn-sm btn-danger"
                                            th:onclick="@{'location.href=\'' + ${#httpServletRequest.getContextPath()}+'/order/delete/'+${order.getOrder_number()}+'\''}">
                                        删除
                                    </button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--内容结束-->
<!-- 底部栏 -->
<!--<div th:replace="fragments/common_footer :: foot-bar"></div>-->
<!-- 底部栏结束 -->
<div th:replace="fragments/common_script :: scripts"></div>
</body>
<!-- Page-Level Scripts -->
<script>
    $(document).ready(function () {
        $('.dataTables-example').DataTable({
            pageLength: 10,
            responsive: true,
            dom: '<"html5buttons"B>lTfgitp',
            buttons: [
                {extend: 'copy'},
                {extend: 'csv'},
                {extend: 'excel', title: '订单列表'},
                {extend: 'pdf', title: '订单列表'},
                {
                    extend: 'print',
                    customize: function (win) {
                        $(win.document.body).addClass('white-bg');
                        $(win.document.body).css('font-size', '10px');
                        $(win.document.body).find('table')
                            .addClass('compact')
                            .css('font-size', 'inherit');
                    }
                }
            ]
        });
    });


</script>


</html>